package com.controller;

import java.util.ArrayList;
import java.util.Date;

import com.log.GPSLogEntry;
import com.persistence.LogAccessObject;

public class GPSLogManager{
	private LogAccessObject logDAO;
	
	public GPSLogManager(){
		logDAO = new LogAccessObject();
	}
	
	public void registerLogEntry(GPSLogEntry logEntry){
		logDAO.insertObject(logEntry);
	}
	
	public ArrayList<GPSLogEntry> getUserLogRegister(String username,Date searchingDate){
		logDAO.setAppUsername(username);
		ArrayList<GPSLogEntry> logRegister = logDAO.getObject(username,searchingDate);
		logDAO.setAppUsername(null);
		return logRegister;
	}
}
